/*--------------------Menu------------------*/
$(document).ready(function(){

	// $(this).hoverAccordionMenu();	//build left menu accordion effects	
	
	/*ie6 hack for mouse over icons on 2nd level. Not part of the plugin. optional!*/
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		//rollover arrow which doesn't work with simple css
		$('ul.site-menu > li > ul > li').bind("mouseenter", function(e){
			$(this).css("background", "url(ico-arrow-level2.gif) no-repeat");
		});
		$('ul.site-menu > li > ul > li').bind("mouseleave", function(e){
			$(this).not(".active").css("background", "none");
		});
	}
});
$(document).ready(function() {
	$("a.example1").fancybox();	
	$("#district_id").selectbox();
});

/*function searchContent(start) {	
	//ajax load content

	//$("#start").val(start);
	var content=$("#search_content").val();
	//var get_search=<?=modules::run('article/_get_search',content);?>
	$.post(root + 'article/search', {
		start : start,
		content : content,
		search_field : $("#search_field").val()
	}, function (data) {
		$(".content_section").html(data);
	
	})
}*/
function enterSearch(e){
	var search = $('#search_content').val();
	if(search != '')
	{
		if (e.keyCode == 13){ 
			return true;
		}
	}else{
		if (e.keyCode == 13){ 
			return false;
		}
	}
}

/*--------------------Tooltip------------------*/
$(document).ready(function(){
	$('.type-middle .md-sp:first').css('padding-left','0px');
	$('.type-middle .tooltip').hide();
	$('.icon-top').hide();
	$('.type-middle .md-sp').hover(function(){
		$(this).children(".icon-top").animate({opacity: "show"}, "fast");
		$(this).children(".tooltip").animate({opacity: "show"}, "fast");
	}, function() {
		$(this).children(".icon-top").animate({opacity: "hide"}, "fast");
		$(this).children(".tooltip").animate({opacity: "hide"}, "fast");
	});

});

/*--------------------Fix HTML------------------*/

$(document).ready(function(){
	$('.sp-middle img').hover(function(){
		$(this).animate({opacity: "0.5"}, "fast");
	}, function() {
		$(this).animate({opacity: "1"}, "fast");
	});
	$('.right img').hover(function(){
		$(this).animate({opacity: "0.5"}, "fast");
	}, function() {
		$(this).animate({opacity: "1"}, "fast");
	});
	$('.m-content img').hover(function(){
		$(this).animate({opacity: "0.5"}, "fast");
	}, function() {
		$(this).animate({opacity: "1"}, "fast");
	});
	$('.images').hover(function(){
		$(this).animate({opacity: "0.5"}, "fast");
	}, function() {
		$(this).animate({opacity: "1"}, "fast");
	});
	$('.setsp').hover(function(){
		$(this).children(".ree").animate({opacity: "0.5"}, "fast");
	}, function() {
		$(this).children(".ree").animate({opacity: "1"}, "fast");
	});
	$('.cont').hover(function(){
		$(this).children(".ree").animate({opacity: "0.5"}, "fast");
	}, function() {
		$(this).children(".ree").animate({opacity: "1"}, "fast");
	});
	$('.content_section .sp:even').css('padding-right','30px');
	$('.site-menu .title-1:last').css('border-bottom','1px dotted #BEBEBE');
	$('.nsx .provice:first').css('border-top','none');
	//var n= 0;
	$('.all-typesp .ct-allsp:eq(0)').css('padding-left','0px');
});

/*--------------------Slider Banner------------------*/
$(function(){
  $('.banner_section ul').bxSlider({
    mode: 'fade',
    captions: true,    
    auto: true,    
    controls: false,
    pause : 6000,
    speed : 1000
  });
});

$(function(){
  $('.banner_slide ul').bxSlider({
    mode: 'fade',
    captions: true,    
    auto: true,    
    controls: false,
    pause : 6000,
    speed : 1000
  });
});
/*--------------------Slider Product------------------*/
$(function(){
   $('.sp_tuongtu_bottom ul').bxSlider({
		auto: false,
		options:'horizontal',
		displaySlideQty:5,
		mode: 'horizontal'
	});

  });